-- Add migration script here
BEGIN;
ALTER TABLE subscriptions ADD COLUMN STATUS TEXT NULL;

UPDATE subscriptions SET STATUS = 'confirmed' WHERE STATUS IS NULL;

ALTER TABLE subscriptions ALTER COLUMN STATUS SET NOT NULL;
COMMIT;

CREATE TABLE subscription_tokens(
	SUBSCRIPTION_TOKEN TEXT NOT NULL,
	SUBSCRIBER_ID UUID NOT NULL REFERENCES subscriptions (ID),
	PRIMARY KEY (subscription_token)
);
